<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2019-07-03
  Time: 14:17
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
   <title>线边库</title>
   <meta name="renderer" content="webkit">
   <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
   <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
   <jsp:include page="${pageContext.request.contextPath }/resource_path.jsp" flush="true"/>
   <script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery.treetable.js"></script>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/jquery.treetable.css">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/jquery.treetable.theme.default.css">
   <style type="text/css">
       .layui-table-click{
           background-color:#ddf2e9 !important;
       }
   </style>
   
   <script type="text/javascript">
   
	$(document).ready(function(){
	    $.ajax({
	        "type" : 'post',
	        "url" : '${pageContext.request.contextPath }/costReport/reslist.do',
	        "dataType" : "json",
	        "success" : function(data) {
	        	$.each(data.data, function(idx, obj) {
	                $("#treeTable").append("<tr data-tt-id=\"" + obj.id + "\" data-tt-parent-id=\"" + obj.fid + "\"><td>" + obj.cname + "</td><td>" + obj.monthMoney + "</td><td>" + obj.yearMoney 
	                		+ "</td></tr>");
	            });
	            $("#treeTable").treetable({  
	                expandable : true,
	                initialState:"expanded",
	                //expandable : true
	                clickableNodeNames:true,//点击节点名称也打开子节点.
	                indent : 50//每个分支缩进的像素数。
	            });
	        }
	    });
	});
	
</script>
</head>
<body>
	<table id="treeTable" style="width:800px">  
        <tr>  
             <td>科目</td> 
             <td>本月合计</td>
             <td>本年合计</td> 
         </tr>  
    </table>  
</body>
</html>